import req from '../common/requrest.js'
export const getToken = (data) => {
	return req.ajax({
		title: "登录中",
		method: "POST",
		path: '/oauth2/wechat-miniapp',
		data,
		hostType: "user" // 标识请求葡萄用户中心
	})
} 
export const setUserInfo = (data) => {
	return req.ajax({
		title: "设置用户信息",
		method: "POST",
		path: '/oauth2/wechat-miniapp/userinfo',
		data,
		hostType: "user" 
	})
} 
export const setUserPhone = (data) => {
	return req.ajax({
		title: "设置用户手机号",
		method: "POST",
		path: '/login/wechat-miniapp/mobile',
		data,
		hostType: "user" 
	})
} 

export const getUserInfoFun = (data) => {
	return req.ajax({
		method: "GET",
		path: '/userinfo/wechatoffiaccount',
		data,
		hostType: "user" 
	})
} 

export const unbindUserPhone = (data) => {
	return req.ajax({
		title: "解绑账号中",
		method: "POST",
		path: '/oauth2/unbind',
		data,
		hostType: "user" 
	})
} 



export const getTaskToken = (data) => {
	return req.ajax({
		title: "设置用户手机号",
		method: "GET",
		path: '/api/weixin/code',
		data,
	})
} 

export const updateTaskUserInfo = (data) => {
	return req.ajax({
		title: "绑定抖音号",
		method: "POST",
		path: '/api/user/updateuserinfo',
		data,
	})
} 

export const getTaskUserInfo = (data) => {
	return req.ajax({
		title: "",
		method: "GET",
		path: '/api/user/userinfo',
		data,
	})
} 

export const getUserPrize = (data) => {
	return req.ajax({
		title: "",
		method: "GET",
		path: '/api/user/prize',
		data,
	})
} 

